<template>
  <van-nav-bar title="分销会员" left-text="" left-arrow @click-left="goBack" />
  <div class="out">
    <div class="item" v-for="item in info">
      <van-image
        round
        width="15%"
        :src="item.avatar_text"
      />
      <div class="text">
        <h4>{{item.nickname}}</h4>
        <p>{{item.mobile}}</p>
      </div>
      <div class="time">{{item.createtime_text}}</div>
    </div>
  </div>
</template>

<script setup>
const { proxy } = getCurrentInstance()
const goBack = () => { proxy.$router.push('/business/index') }
const LoginUser = reactive(proxy.$cookies.get("LoginUser"))
const info =ref([])


onBeforeMount(() => {
  getMemberData()
})
const getMemberData = async () => {
  let result = await Api.PosMember({busid: LoginUser.id})
  if (result.code == 1) {
    info.value=result.data
    console.log(info.value);
  }
}
</script>

<style scoped>
.out{
  width: 100%;
  height: 95vh;
  display: flex;
  flex-direction: column;
  background-color: #eeeeee;
  align-items: center;
  box-sizing: border-box;
  padding: 2vh 0;
}
.item{
  width: 90%;
  display: flex;
  justify-content: space-between;
  box-sizing: border-box;
  padding: 1.2rem 1rem;
  margin-bottom: 1vh;
  background-color: #ffffff;
  border-radius: 8px;
}
.item .text{
  width: 50%;
  font-size: 0.9rem;
  margin: 0 1vh;
}
.item .text p{
  font-size: 0.9rem;
  color: #969696;
}
.item .time{
  width: 30%;
  font-size: 0.8rem;
  color: #3e3e3e;
  display: flex;
  align-items: center;
  justify-content: end;
}
.item div{
  width: 100%;
  text-align: left;
}
.van-image img{
  width: 5vh;
  height: 5vh;
}
</style>